package com.java.Impl;

import com.java.It.ComputerPart;
import com.java.It.ComputerPatVisitor;

public class Computer implements ComputerPart {

    ComputerPart[] parts;

    public Computer() {
         parts=new ComputerPart[]{new Mouse(),new KeyBoard(),new Monitor()};
    }

    @Override
    public void accept(ComputerPatVisitor computerPatVisitor) {
        for (int i=0;i<parts.length;i++){
            parts[i].accept(computerPatVisitor);
        }
        computerPatVisitor.visit(this);
    }
}
